﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;

namespace DispatchAssist.BusinessLogical.Model
{
    /// <summary>
    /// MeteoMsg
    /// </summary>
    public class MeteoMsg
    {

        /// <summary>
        /// MeteoMsg 构造函数
        /// </summary>
        public MeteoMsg()
        { }


        /// <summary>
        /// MeteoMsg OR映射构造函数
        /// </summary>
        public MeteoMsg(System.Data.IDataReader dr)
        {
            this.MetroMsgID = (Guid)dr["MetroMsgID"];
            this.Airport = Convert.ToString(dr["Airport"]);
            this.WarnTime = Convert.ToDateTime(dr["WarnTime"]);
            this.WarnLevel = Convert.ToInt32(dr["WarnLevel"]);
            this.WarnMsg = Convert.ToString(dr["WarnMsg"]);
            this.WarnInfo = Convert.ToString(dr["WarnInfo"]);
            this.FileName = Convert.ToString(dr["FileName"]);
            this.FileCreateTime = Convert.ToDateTime(dr["FileCreateTime"]);
            this.FileDownloadTime = Convert.ToDateTime(dr["FileDownloadTime"]);
            this.AlertCreateTime = Convert.ToDateTime(dr["AlertCreateTime"]);
            this.MsgStatus = Convert.ToInt32(dr["MsgStatus"]);
            this.LastModifyTime = Convert.ToDateTime(dr["LastModifyTime"]);
            this.DeleteFlag = Convert.ToBoolean(dr["DeleteFlag"]);
            this.WarnStandard = Convert.ToString(dr["WarnStandard"]);
        }


        /// <summary>
        /// 唯一标识
        /// </summary>
        public Guid MetroMsgID { get; set; }

        /// <summary>
        /// 预警机场
        /// </summary>
        public string Airport { get; set; }

        /// <summary>
        /// 预警时间
        /// </summary>
        public DateTime WarnTime { get; set; }

        /// <summary>
        /// 预警级别
        /// </summary>
        public int WarnLevel { get; set; }

        /// <summary>
        /// 预警原始报文
        /// </summary>
        public string WarnMsg { get; set; }

        /// <summary>
        /// 中文气象预警信息
        /// </summary>
        public string WarnInfo { get; set; }

        /// <summary>
        /// 预警报文名称
        /// </summary>
        public string FileName { get; set; }

        /// <summary>
        /// 预警报文文件创建时间
        /// </summary>
        public DateTime FileCreateTime { get; set; }

        /// <summary>
        /// 报文文件下载时间
        /// </summary>
        public DateTime FileDownloadTime { get; set; }

        /// <summary>
        /// 报警生成时间
        /// </summary>
        public DateTime? AlertCreateTime { get; set; }

        /// <summary>
        /// 预警信息状态
        /// </summary>
        public int MsgStatus { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>
        public DateTime LastModifyTime { get; set; }

        /// <summary>
        /// 逻辑删除标记
        /// </summary>
        public bool DeleteFlag { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string WarnStandard { get; set; }

        public int RelationType { get; set; }

        public override string ToString()
        {
            return string.Format("[预警机场:{0},预警时间：{1}]", Airport, WarnTime.ToString());
        }
    }
}
